<!--
 * @Descripttion: 
 * @version: 
 * @Author: Jun
 * @Date: 2021-05-26 14:18:21
 * @LastEditors: Jun
 * @LastEditTime: 2021-05-26 14:51:33
-->
<template>
  <el-checkbox-group
    v-model="checkList"
    @change="handlerChange"
    :disabled="isDisabled"
  >
    <el-checkbox
      v-for="item of valueArray"
      :key="item.label"
      :label="item.label"
      >{{ item.content }}</el-checkbox
    >
  </el-checkbox-group> 
</template>

<script>
export default {
  props: {
    valueArray: {
      //数据数组
      type: Array,
      required: true,
    },
    currentArray: {
      //当前选中的数组
      type: Array,
      required: true,
    },
    isDisabled: {
      type: Boolean,
      default: false,
    },
  },
  model: {
    prop: "currentArray",
    event: "change",
  },
  data() {
    return {
      checkList: this.currentArray,
    };
  },
  methods: {
    handlerChange(val) {
      this.$emit("change", val);
    },
  },
};
</script>

<style>
</style>